import numpy as np

from core.layer import Layer
from implement.layers.basic.affine import Affine
from utils.functions_collect import sigmoid

np.random.seed(8)
x = np.random.rand(100, 1)
y = np.sin(2 * np.pi * x) + np.random.rand(100, 1)

model = Layer()
# 只指定输出大小
model.l1 = Affine(5)
model.l2 = Affine(1)

# 进行推理的函数
def predict(model, x):
    y = model.l1(x)
    y = sigmoid(y)
    y = model.l2(y)
    return y


for p in model.params():
    print(p.data)

model.cleargrads()